/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.workflow.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author wzp
* @date 2021-04-27
**/
@Entity
@Data
@Table(name="activiti_form")
public class ActivitiForm implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "主键")
    private Long id;

    @Column(name = "name")
    @ApiModelProperty(value = "表单名称")
    private String name;

    @Column(name = "code")
    @ApiModelProperty(value = "表单编码")
    private String code;

    @Column(name = "model_id")
    @ApiModelProperty(value = "模型id")
    private String modelId;

    @Column(name = "model_name")
    @ApiModelProperty(value = "模型名称")
    private String modelName;

    @Column(name = "type")
    @ApiModelProperty(value = "表单类型（1、定制设计；2-自定义绘制）")
    private String type;

    @Column(name = "content")
    @ApiModelProperty(value = "表单内容")
    private String content;

    @Column(name = "form_path")
    @ApiModelProperty(value = "定制表单路径")
    private String formPath;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建者")
    private String createBy;

    @Column(name = "update_by")
    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @Column(name = "create_time")
    @CreationTimestamp
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "update_time")
    @UpdateTimestamp
    @ApiModelProperty(value = "修改时间")
    private Timestamp updateTime;

    public void copy(ActivitiForm source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}